package test;



import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import expression.PostfixEvaluator;

public class ChristianMarinPETest {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testOne(){
		//3+4*5/7
		int answer = PostfixEvaluator.eval("3 4 5 * 7 / +");
		
		assertTrue(answer == 5);
	}
	
	@Test
	public void testTwo() {
		//(4+8)*(6-5)/((3-2)*(2+2))
		int answer = PostfixEvaluator.eval("4 8 + 6 5 - * 3 2 - 2 2 + * /");
		
		assertTrue(answer == 3);
		
	}
	@Test
	public void testThree() {
		//(300+23)*(43-41)
		int answer = PostfixEvaluator.eval("300 23 + 43 41 - *");
		
		assertTrue(answer == 646);
		
	}
	
	@Test 
	public void testFour(){
		//(3+3)^2 + (4+2)^4
		
		int answer = PostfixEvaluator.eval("3 3 + 2 ^ 4 2 + 4 ^ +");
		
		assertTrue(answer == 1332);
		
	}
	@Test 
	public void testFive(){
		//(4+5)/(5-2) * 5^2
		
		int answer = PostfixEvaluator.eval("4 5 + 5 2 - / 5 2 ^ *");
		
		assertTrue(answer == 75);
		
	}

}
